package com.jtny.nytb.equipment.vo.instrument;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jtny.nytb.valid.annotation.ValueValid;
import com.jtny.nytb.valid.param.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author 智慧能源中心-伍天宇
 * @version 1.0
 * @package com.jtny
 * @fileName InstrumentFromVO.java
 * @createTime 2024年01月11日 13:17
 * @Copyright© 2024 jtny
 * 江投能源技术研究院 版权所有
 */
@Data
@ApiModel
public class InstrumentFromVO implements Serializable {
    // 基础信息
    @ApiModelProperty(value = "计量器具ID")
    @NotNull(message = "计量具ID不能为空", groups = Update.class)
    private Long id;

    @ApiModelProperty("计量器具名称")
    private String instrumentName;

    @ApiModelProperty(value = "计量具类型", required = true)
    @NotBlank(message = "计量器具类型不能为空")
    private String instrumentType;

    @ApiModelProperty(value = "计量器具级别", required = true)
    @ValueValid(intValues = {1, 2, 3}, message = "计量器具级别不能为空")
    private Integer instrumentLevel;

    @ApiModelProperty(value = "计量相关参数", required = true)
    @NotBlank(message = "计量相关参数不能为空")
    private String instrumentParameter;

    @ApiModelProperty(value = "计量器具编号")
    private String instrumentNo;

    @ApiModelProperty(value = "生产厂家")
    private String instrumentVendor;

    @ApiModelProperty(value = "型号规格")
    private String instrumentModel;

    @ApiModelProperty(value = "准确度等级")
    private String instrumentPrecision;

    @ApiModelProperty(value = "测量范围")
    private String instrumentRange;

    // 校准信息
    @ApiModelProperty(value = "检验机构")
    private String calibrationInstitution;

    @ApiModelProperty(value = "检验状态：合格/不合格")
    @ValueValid(strValues = {"合格", "不合格"}, message = "检验状态非法")
    private String calibrationStatus;

    @ApiModelProperty(value = "检验周期： X/月， X/年")
    private String calibrationCycle;

    @ApiModelProperty(value = "上次检验时间")
    @PastOrPresent(message = "上次检验时间非法")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date calibrationLastTime;

    @ApiModelProperty(value = "下次检验时间")
    @Future(message = "下次检验时间非法")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date calibrationNextTime;

    @ApiModelProperty(value = "检验原因")
    private String calibrationReason;

    @ApiModelProperty(value = "是否开启检测报警 1 - 开启 0 - 关闭")
    private Integer detectionAlarm;

    // 安装信息
    @ApiModelProperty(value = "安装时间")
    @Past(message = "安装时间非法")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date installTime;

    @ApiModelProperty(value = "安装地点")
    private String installLocation;

    @ApiModelProperty(value = "安装方")
    @ValueValid(intValues = {1, 2, 3}, message = "安装方非法")
    private Integer installOperator;

    @ApiModelProperty(value = "安装系统")
    @ValueValid(intValues = {1, 2}, message = "安装系统非法")
    private Integer installSystem;

    @ApiModelProperty(value = "当前状态")
    @ValueValid(intValues = {1, 2, 3}, message = "当前状态非法")
    private Integer nowStatus;

    @ApiModelProperty(value = "当前状态时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @Past(message = "当前状态时间非法")
    private Date nowStatusTime;

    @ApiModelProperty(value = "数据上报")
    private List<InstrumentReportFromVO> reportList;
}
